@echo off
echo Setting up Ollama for ls8shell AI Terminal
echo ==========================================

echo Step 1: Installing dependencies...
pip install requests

echo.
echo Step 2: Download and install Ollama
echo Please download Ollama from: https://ollama.ai/
echo.
pause
echo.

echo Step 3: Pull LLaMA chat model
echo This will download the AI model (about 4GB)
ollama pull llama2:7b-chat

echo.
echo Step 4: Start Ollama service
echo Starting Ollama in background...
start /B ollama serve

echo.
echo Waiting for Ollama to start...
timeout /t 5 /nobreak > nul

echo.
echo Step 5: Test Ollama connection
python -c "import requests; r = requests.get('http://localhost:11434/api/tags', timeout=5); print('✅ Ollama is running!' if r.status_code == 200 else '❌ Ollama not responding')"

echo.
echo ==========================================
echo Setup complete! You can now:
echo 1. Run: python start_server.py
echo 2. Open: http://localhost:8000
echo 3. Type Chinese commands like "列文件" and they'll work with AI!
echo ==========================================
pause